<template>
  <div>
    <el-row>
      <!-- 分类 -->
      <el-col :span="6">
        <Category @getCategoryId="handlerGetCategoryId" />
      </el-col>

      <!-- 商品 -->
      <el-col :span="18">
        <Product :category-id="categoryId" />
      </el-col>
    </el-row>
  </div>
</template>

<script>
import Category from './category.vue'
import Product from './product.vue'

export default {
  components: {
    Category,
    Product
  },
  data() {
    return {
      categoryId: undefined
    }
  },

  methods: {
    // 字典选择回调
    handlerGetCategoryId(data) {
      this.categoryId = data
    }
  }
}
</script>
